<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台登录 - 个人网站管理</title>
    <link rel="stylesheet" type="text/css" href="/static/css/nekotora.css">
    <link rel="stylesheet" type="text/css" href="/static/css/login.css">
    <link rel="icon" href="/static/favicon.ico" type="image/x-icon">
    
    <!-- 背景动效配置 -->
    <script>
        // 全局背景动效配置变量，供其他脚本使用
        window.backgroundEffect = '{{ config.background_effect if config else "stars" }}';
        // 添加背景图片URL配置，使用与主页面相同的健壮配置方案
        window.backgroundImageUrl = '{{ config.background_image_url if config and config.background_image_url else "/static/uploads/backgrounds/background_1762498584_122.jpeg" }}';
    </script>
    
    <!-- 引入脚本 -->
    <script src="/static/js/background-effects.js"></script>
    <script src="/static/js/login.js"></script>
    <script src="/static/js/admin/login-responsive.js"></script>
</head>
<body>
    <div class="background">
        <div id="background-container">
            <canvas id="background-canvas"></canvas>
        </div>
        <div class="cover"></div>
    </div>
    <div class="login-container">
        <div class="login-header">
            <h2>后台管理系统</h2>
        </div>
        
        {% if error %}
        <div class="error-message">
            {{ error }}
        </div>
        {% endif %}
        
        <form method="post" action="/admin/login{% if redirect %}?redirect={{ redirect }}{% endif %}">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" id="username" name="username" required>
            </div>
            
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" id="password" name="password" required>
            </div>
            
            <button type="submit" class="btn">登录</button>
        </form>
        
        <div class="footer">
                个人网站管理后台 &copy; 2025
            </div>
    </div>
    <!-- 登录页面脚本已通过外部文件引入 -->
</body>
</html>